home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 9 / FM Towns Free Software Collection 9.iso / t_os / data / fapx / fapxrtn.plp < prev    next >
Text File  |  1994-11-16  |  7KB  |  332 lines

  1. /*    発言数及びリミット数から指定番号を調整・タイプする    */
  2. %TypeNum{
  3.     [rtnline,spkmax,limit]
  4.     var    Nrtn    [3];
  5.     var    First    [1];
  6.     var    RtnNumA    [5];
  7.     var    RtnNumB    [5];
  8.     %rtn    @tail(@read(UP2|{fapxrtn.ctl},rtnline,1),{rtn=},{\n});
  9.     dispoff(!DEBUG);
  10.     display({\n指定された発言番号:#}|rtn);
  11.     display({\n発言数:}|spkmax|{  ボーダーライン:#});
  12.     case( spkmax - limit <= 0,
  13.         {Yes},{display({1\n})},
  14.         {No},{display(spkmax-limit|{\n})}
  15.         );
  16.     dispoff({No});
  17.     Nrtn:=1;
  18.     First:=0;
  19.     loop({
  20.         %rtnpart    @nth(rtn,Nrtn,{,});
  21.         case( ( @body(rtnpart,{-}) = {} ) &&
  22.             ( @body(rtnpart,,{-}) = {} ),
  23.             {Yes},
  24.             {
  25.             case    (rtnpart <> {},
  26.                 {Yes},
  27.                 {case    ( rtnpart > ( spkmax - limit ),
  28.                     {Yes},
  29.                     {case(First=0,
  30.                         {Yes},{type({#})},
  31.                         {No},{type({,})}
  32.                         );
  33.                     type(rtnpart);
  34.                     First:=1;
  35.                     });
  36.                 im({Yes})
  37.                 },
  38.                 {No},{im({No})}
  39.                 );
  40.             },
  41.             {No},
  42.             {
  43.             %rtna @body(rtnpart,,{-});
  44.             %rtnb @body(rtnpart,{-});
  45.             case(( rtna>0 ) && ( rtn >0 )&&( rtna>=rtnb ),
  46.                 {Yes},
  47.                 {RtnNumA:=rtnb;RtnNumB:=rtna},
  48.                 {No},
  49.                 {RtnNumA:=rtna;RtnNumB:=rtnb}
  50.                 );
  51.             case( RtnNumA > ( spkmax - limit ),
  52.                 {No},
  53.                 {
  54.                 case( RtnNumB = {},
  55.                     {Yes},
  56.                     {RtnNumA:=spkmax - limit + 1},
  57.                     {No},
  58.                     {RtnNumA:={}}
  59.                     );
  60.                 });
  61.             case( RtnNumB > ( spkmax - limit ),
  62.                 {No},{RtnNumB:={}}
  63.                 );
  64.             case( ( RtnNumA = {} ) && ( RtnNumB = {} ),
  65.                 {No},
  66.                 {case( First = 0,
  67.                     {Yes},{type({#})},
  68.                     {No},{type({,})}
  69.                     );
  70.                 type(RtnNumA|{-}|RtnNumB);
  71.                 First:=1;
  72.                 });
  73.             im({Yes});
  74.             });
  75.             Nrtn:=Nrtn+1;
  76.         });
  77.         case( First = 1,
  78.             {Yes},{type({\n});im({OK})},
  79.             {No},{im({OUT})}
  80.             );
  81.     };
  82.  
  83. %FDwn1{
  84.     %PrmptChk{
  85.         wait(,,
  86.             {入力して下さい◆\n}|
  87.             {電子会議 (1:発言 改行のみ: 読む) 通常モード\n>},
  88.             {im({Error})},
  89.             {入力して下さい◆\n電子会議 }|
  90.             {(1:発言  改行のみ: 読む) ペアレントモード\n>},
  91.             {im({Error})},
  92.             {入力して下さい◆\n}|
  93.             {電子会議 (改行のみ: 読む) 通常モード\n>},
  94.             {im({Error})},
  95.             {入力して下さい◆\n}|
  96.             {電子会議 (改行のみ: 読む) ペアレントモード\n>},
  97.             {im({Error})},
  98.             {\n電子会議 (1:発言 改行のみ: 読む) 通常モード\n>},
  99.             {im({Ok})},
  100.             {\n電子会議 (1:発言  改行のみ: 読む)}|
  101.             { ペアレントモード\n>},
  102.             {im({Ok})},
  103.             {\n電子会議 (1:発言 2:コメントを読む }|
  104.             {改行のみ: 読む) 通常モード\n>},
  105.             {im({Ok})},
  106.             {\n電子会議 (改行のみ: 読む) 通常モード\n>},
  107.             {im({Ok})},
  108.             {\n電子会議 (改行のみ: 読む) ペアレントモード\n>},
  109.             {im({Ok})});
  110.         };
  111.     case(@TypeNum(rtnline,MesNum,{999}),
  112.         {OK},
  113.         {case(@PrmptChk,
  114.             {Error},
  115.             {case(@TypeNum(rtnline,MesNum,{512}),
  116.                 {OK},
  117.                 {case(@PrmptChk,
  118.                     {Error},
  119.                     {display(
  120.                         {\n作動が一寸おかしいです。\n})},
  121.                     {Ok},{/*正常作動*/});
  122.                 })},
  123.             {Ok},{/*正常作動*/});
  124.         });
  125.     };
  126.  
  127. /*    フォーラムと会議室を指定して指定発言をダウンする    */
  128. %FORUMdown{
  129.     [forum,mes,rtnline]
  130.     var    RtnNumA[5];
  131.     var    RtnNumB[5];
  132.     %CHKFTOP{
  133.         case(Rwhere2=forum,
  134.             {Yes},
  135.             {im(@case(@GO({forum/}|forum|{/mes/}|mes),
  136.                 {Yes},{im({Yes})},
  137.                 {ReadOnly},{im({Yes})},
  138.                 ,{im({No})}))},
  139.             {No},
  140.             {im(@case(@GO({forum/}|forum),
  141.                 {Yes},
  142.                 {type({SET PAUSE OFF\n});
  143.                  WAITABORT(Wtime2);
  144.                  case(@GO({forum/}|forum|{/mes/}|mes),
  145.                     {Yes},{im({Yes})},
  146.                     {ReadOnly},{im({Yes})},
  147.                     ,{im({No})})},
  148.                 {No},
  149.                 {im({No})}
  150.                 ));
  151.             });
  152.         };
  153.  
  154.     case(LOGmode,
  155.         {forum},
  156.         {case(Rwhere1,
  157.             {PATIO},
  158.             {LOGforum({PATIO\}|Rwhere2,{stop});
  159.              LOGforum(forum,{start})},
  160.             {FORUM},
  161.             {case( Rwhere2 <> forum,
  162.                 {Yes},
  163.                 {LOGforum(Rwhere2,{stop});
  164.                  LOGforum(forum,{start})}
  165.                 );
  166.             },
  167.             {},
  168.             {LOGforum(forum,{start})}
  169.             );
  170.         });
  171.  
  172.     case(@CHKFTOP,
  173.         {Yes},
  174.         {
  175.         %a @laststr(128);
  176.         %b @head(@body(a,{ 発言数 :}),{ 未読 :});
  177.         case( b = {},{No},{MesNum:=b});
  178.         dispoff(!DEBUG);
  179.         display({\n発言数は現在:}|MesNum|{です。\n});
  180.         dispoff({No});
  181.         Rwhere1:={FORUM};
  182.         Rwhere2:=forum;
  183.         FDwn1;
  184.         },
  185.         {No},
  186.         {case(LOGmode,
  187.             {forum},
  188.             {LOGforum(forum,{stop});
  189.              Rwhere1:={};Rwhere2:={}}
  190.             );
  191.         });
  192.     };
  193.  
  194. /*    パティオを指定して指定発言をダウンする    */
  195. %PATIOdown{
  196.     [patioid,pass,mes,rtnline]
  197.     case( LOGmode,
  198.         {forum},
  199.         {case( Rwhere1,
  200.             {PATIO},
  201.             {case( Rwhere2 <> patioid,
  202.                 {Yes},
  203.                 {LOGforum({PATIO\}|Rwhere2,{stop});
  204.                  LOGforum({PATIO\}|patioid,{start})}
  205.                 );
  206.             },
  207.             {FORUM},
  208.             {LOGforum(Rwhere2,{stop});
  209.              LOGforum({PATIO\}|patioid,{start})},
  210.             {},
  211.             {LOGforum({PATIO\}|patioid,{start})}
  212.             );
  213.         });
  214.     case(@GO({patio/}|patioid|{/}|pass|{/MES/1}),
  215.         {Yes},
  216.         {
  217.         %a @laststr(128);
  218.         %b @getchar(@head(@body(a,{最新  会議室名\n}),{\n}),6,5);
  219.         case( b = {},{No},{MesNum:=b});
  220.         dispoff(!DEBUG);
  221.         display({\n発言数は現在:}|MesNum|{です。\n});
  222.         dispoff({No});
  223.         Rwhere1:={PATIO};
  224.         Rwhere2:=patioid;
  225.         type({SET PAUSE OFF\n});
  226.         WAITABORT(Wtime2);
  227.         case(@TypeNum(rtnline,MesNum,{512}),
  228.             {OK},
  229.             {
  230.             wait(,,
  231.                 {◆番号又はコマンドを入力して下さい◆\n}|
  232.                 {PATIO(N)>},
  233.                 {display({\n作動が一寸おかしいです。\n})},
  234.                 {\nPATIO(N)>},,
  235.                 {◆番号又はコマンドを入力して下さい◆\n}|
  236.                 {PATIO(P)>},
  237.                 {display({\n作動が一寸おかしいです。\n})},
  238.                 {\nPATIO(P)>},
  239.                 );
  240.             });
  241.         },
  242.         {No},
  243.         {
  244.         case(LOGmode,
  245.             {forum},
  246.             {LOGforum({PATIO\}|patioid,{cancel});
  247.             });
  248.         Rwhere1:={};
  249.         Rwhere2:={};
  250.         });
  251.     };
  252.  
  253. /*    ダウン先の振り分け    */
  254. %AUTOrtnDWN1{
  255.     case    (@head(linebuf,{=}),
  256.         {forum},
  257.         {
  258.         FORUMdown(    @tail(linebuf,{forum=},{;}),
  259.                 @tail(linebuf,{mes=},{;}),
  260.                 line);
  261.         im({Yes});
  262.         },
  263.         {patio},
  264.         {
  265.         PATIOdown(    @tail(linebuf,{patio=},{;}),
  266.                 @tail(linebuf,{pass=},{;}),
  267.                 @tail(linebuf,{mes=},{;}),
  268.                 line);
  269.         im({Yes});
  270.         },
  271.         {},{im({No})},    /* 空文字列なら終了 */
  272.         ,{im({Yes})}    /* それ以外なら次の行を読む */
  273.         );
  274.     };
  275.  
  276. %AUTOrtn{
  277.     [file]
  278.     case    (@filechk(file),
  279.         {Yes},
  280.         {
  281.         Rwhere1:={};
  282.         Rwhere2:={};
  283.         line:=0;
  284.         loop    ({
  285.             line:=line+1;
  286.             linebuf:={};
  287.             linebuf:=@read(file,line,1);
  288.             AUTOrtnDWN1;
  289.             });
  290.         case(LOGmode={forum}&&Rwhere2<>{},
  291.             {Yes},{LOGforum(Rwhere2,{stop})});
  292.         },
  293.         {No},
  294.         {
  295.         SNDMSG({okasi_f.snd});
  296.         display({\n}|file|{制御ファイルがありません\n});
  297.         });
  298.     };
  299.  
  300. /*    指定発言ダウンロード制御ファイルの有無の判定処理    */
  301. %AUTORTNLOGDOWN
  302.     {
  303.     var    MesNum[5];
  304.     display({指定発言の自動ダウンロードを開始します\n});
  305.     footnote({指定発言の自動ダウンロードをしています});
  306.     case(@filechk(UP2|{fapxrtn.ctl}),
  307.         {Yes},
  308.         {AUTOrtn(UP2|{fapxrtn.ctl});
  309.         case(@filechk(UP2|{fapxrtn.rsv}),{Yes},
  310.             {copyfile(UP2|{fapxrtn.rsv},UP2|{fapxrtn.bak});
  311.             addfile(UP2|{fapxrtn.ctl},UP2|{fapxrtn.bak});
  312.             },{No},
  313.             {dispoff(!DEBUG);
  314.             command({copy }|UP2|{fapxrtn.ctl }|UP2|{fapxrtn.bak});
  315.             dispoff({No});
  316.             });
  317.         delfile(UP2|{fapxrtn.ctl});
  318.         });
  319.     };
  320.  
  321. /*    自動通信処理    */
  322. var    line    [3];
  323. var    linebuf    [1024];
  324. var    Rwhere1    [5];
  325. var    Rwhere2    [8];
  326.  
  327. case( (DNT={first}) || (DNT={last}),
  328.     {Yes},
  329.     {case(@filechk(UP2|{fapxrtn.ctl}),{Yes},
  330.         {AUTORTNLOGDOWN;Where:={}});
  331.     });
  332.